# -*- coding: utf-8 -*-
# ----------------------------
# @Time    : 2021/7/4 4:36 下午
# @Author  : changqingai
# @FileName: 05-serializers.py
# ----------------------------

from pyspark import SparkContext
from pyspark.serializers import MarshalSerializer

if __name__ == "__main__":
    sc = SparkContext(master='local[2]', appName='serializers', serializer=MarshalSerializer())
    res = sc.parallelize(list(range(1000))).map(lambda x: 2*x).take(10)
    print('res:', res)
    sc.stop()
